package com.zhuss.controller.meeting;

import com.zhuss.bean.bo.meeting.room.ConfirmTimeBo;
import com.zhuss.bean.bo.meeting.room.GetSituationBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import com.zhuss.meeting.time.TimeReadServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhushanshuo
 * @Date: 2020/2/28 15:26
 */
@RestController
@RequestMapping("/meetingTime")
public class TimeReadController extends BaseController {

    @Autowired
    @Qualifier("timeReadService")
    private ReadService<Object, Object> timeReadService;

    @Autowired
    @Qualifier("timeReadServiceExt")
    private TimeReadServiceExt timeReadServiceExt;

    /**
     * 将会议时间存储
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/confirm")
    public void confirm(@RequestBody ConfirmTimeBo bo) throws WpsException {
        timeReadServiceExt.confirm(bo);
    }

    /**
     * 获取会议室情况
     * @param bo
     * @return
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/getSituation")
    public Object getSituation(@RequestBody GetSituationBo bo) throws WpsException {
        return timeReadServiceExt.getSituation(bo);
    }
}
